<?php 
class class_sukien extends database
{
		
	function ListSuKienByNguoiBan($MaNguoiBan,$start,$limit)
	{
		$this->setQuery('set names utf8');
		$this->Query();

		$sql = 'select *
				from su_kien
				where MaNguoiBan='.$MaNguoiBan.'
				order by NgayBatDau desc limit '.$start.','.$limit;

		$this->setQuery($sql);
		$table = $this->LoadAllRow();
		return $table;		
	}
	
	function CountListSuKienByNguoiBan($MaNguoiBan)
	{

		$sql = 'select *
				from su_kien
				where MaNguoiBan='.$MaNguoiBan;

		$this->setQuery($sql);
		$table = $this->LoadAllRow();
		$num = count($table);
		return $num;
	}
	
}
?>